<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .c1{
            width: 100px;
            height: 100px;

            background-color: rgba(255,0,0,0.3);
        }
        .c2{
            width: 100px;
            height: 100px;

            /*background-color: rgba(255,0,0,0.3);*/
            background-color: rgb(255,0,0);

            opacity: 0.3; /* 0-1之间的数字,这是设置整个标签的透明底 */

        }


    </style>

</head>
<body>


<div class="c1">
    div1

</div>
<hr>
<div class="c2">
    div2

</div>






</body>
</html>